package com.pandy.disruptor.senior;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;

/**
 * @description:
 * @author: panhong
 * @date: 2025/4/10
 */
public class Handler1 implements EventHandler<Goods>, WorkHandler<Goods> {
    @Override
    public void onEvent(Goods event, long sequence, boolean endOfBatch) throws Exception {
        this.onEvent(event);
    }

    @Override
    public void onEvent(Goods event) throws Exception {
        System.out.println("消费者 Handler1： setName");
        event.setName("Handler1");
        Thread.sleep(1000);
    }
}
